package http

import (
	"zin/framework/gin"
)

// NewHttpEngine is command
func NewHttpEngine(mode string) (*gin.Engine, error) {
	ginMode := gin.DebugMode

	if mode == "test" {
		ginMode = gin.TestMode
	} else if mode == "prd" {
		ginMode = gin.ReleaseMode
	}

	gin.SetMode(ginMode)
	r := gin.Default()

	Routes(r)
	return r, nil
}
